package com.cats.activity;

import com.cats.R;
import com.cats.adapter.MemberAdapter;

import android.os.Bundle;
import java.util.ArrayList;

import android.support.v4.app.NavUtils;
import android.view.MenuItem;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.AdapterView.OnItemClickListener;

public class AboutActivity extends BaseActivity {

	private ListView listView = null;
	private MemberAdapter adapter = null;
	
	private ArrayList<String> arrayList = null;
	
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_about);
		getActionBar().setDisplayHomeAsUpEnabled(true);
		System.out.println("[AboutActivity]onCreate");	
		setActionBarTitle("About");
		
		if (arrayList == null) {
			arrayList =	new ArrayList<String>();
			arrayList.add("About CaTS");
			arrayList.add("FAQ");
			arrayList.add("Terms & Conditions");
		}
		
		adapter = new MemberAdapter(this, R.layout.member_listview_item, arrayList);
		// new MemberAdapter(this, R.layout.member_listview_item, arrayList);
		listView = (ListView)findViewById(R.id.item_list);
		listView.setAdapter(adapter);	
		
		listView.setOnItemClickListener(new OnItemClickListener() {

			@Override
			public void onItemClick(AdapterView<?> arg0, View arg1, int arg2,
					long arg3) {
				if (arg2 == 0) { // 
					
				}
				else { //
					
				}
			}
		});
	}
	
	
	@Override
	public boolean onOptionsItemSelected(MenuItem item) {
		switch (item.getItemId()) {
		case android.R.id.home:
			NavUtils.navigateUpFromSameTask(this);
			return true;
		}

		return super.onOptionsItemSelected(item);
	}
}

